package com.example.sal.service.impl;

import com.example.sal.pojo.Tech;
import org.springframework.stereotype.Service;


@Service
public class TechServiceImpl {
    /**
     * 计算技术类的员工最终薪资
     * @return
     */
    public Double calTechSal(Tech tech){
        if (tech.getScore()<0.6){
            tech.setAward(0);
        }else if (tech.getScore()<0.8){
            tech.setAward(tech.getBaseSal()*0.2*0.7);
        }else if (tech.getScore()<0.9){
            tech.setAward(tech.getBaseSal()*0.2);
        }else {
            tech.setAward(tech.getBaseSal()*0.2*1.5);
        }
        tech.setTotalSal(tech.getBaseSal()+tech.getAward());
        return tech.getBaseSal()+tech.getAward();

    }
}
